@REM --------------------------------- BEGIN -----------------------------------
@setlocal
@echo off

set rootDir="%CD%"
set outFileBin="%CD%\AOC19NET vX.X.X - Binaries.rar"
set outFileSrc="%CD%\AOC19NET vX.X.X - Sources.rar"
set winrar="C:\Program Files\WinRAR\WinRAR.exe"

REM ---------------------------------------------------------- Binaries
cd "AOC19.NET\bin\Release"
%winrar% a -apAOC19NET %outFileBin% *.dll
%winrar% a -apAOC19NET %outFileBin% *.exe
%winrar% a -apAOC19NET %outFileBin% *.config

cd ..\..
%winrar% a -apAOC19NET %outFileBin% *.txt

REM ---------------------------------------------------------- Sources
cd %rootDir%

rem Local copy without .svn folders
mkdir TMP
mkdir TMP\AOC19.NET
copy *.sln TMP
xcopy AOC19.NET TMP\AOC19.NET /e /c /i /f /r /y
cd TMP

rem Create the package
%winrar% a %outFileSrc% *.sln
%winrar% a -r %outFileSrc% AOC19.NET\Classes\*.*
%winrar% a -r %outFileSrc% AOC19.NET\Controls\*.*
%winrar% a -r %outFileSrc% AOC19.NET\Libs\*.*
%winrar% a -r %outFileSrc% AOC19.NET\Properties\*.*
%winrar% a -r %outFileSrc% AOC19.NET\Resources\*.*

%winrar% a %outFileSrc% AOC19.NET\*.cs
%winrar% a %outFileSrc% AOC19.NET\*.xaml
%winrar% a %outFileSrc% AOC19.NET\*.csproj
%winrar% a %outFileSrc% AOC19.NET\*.ico
%winrar% a %outFileSrc% AOC19.NET\*.txt

rem Delete local copy
cd %rootDir%
rmdir /s /q TMP

@REM ---------------------------------- END ------------------------------------
